package edu.xjdx.os.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.Enumeration;

/**
 * 通用的页面跳转
 */
@Controller
public class CommonController {

    @RequestMapping("{directory}/{destination}")
    public String toDestination(@PathVariable("directory") String directory,@PathVariable("destination") String destination){
        return directory+"/"+destination;
    }

    @RequestMapping("/looksession")
    public String display(HttpSession session){
        for (Enumeration e = session.getAttributeNames(); e.hasMoreElements(); ){
         System.out.println(e.nextElement());
        }
        return "fore/index";
    }
}
